<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>报关单批量测试工具</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <div class="container-fluid">
        <nav class="navbar navbar-dark bg-primary mb-4">
            <div class="container-fluid">
                <span class="navbar-brand mb-0 h1">报关单批量测试工具</span>
            </div>
        </nav>

        <div class="container">
            <div class="row mb-4">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header d-flex justify-content-between align-items-center">
                            <h5 class="mb-0">测试组管理</h5>
                            <div>
                                <div class="form-check form-switch d-inline-block me-3">
                                    <input class="form-check-input" type="checkbox" id="debugMode">
                                    <label class="form-check-label" for="debugMode">调试模式</label>
                                </div>
                                <button class="btn btn-success btn-sm" onclick="addGroup()">
                                    <span>➕</span> 添加大组
                                </button>
                                <button class="btn btn-primary" onclick="startTest()">
                                    <span>🚀</span> 开始测试
                                </button>
                            </div>
                        </div>
                        <div class="card-body">
                            <div id="groups-container">
                                <!-- 大组将动态添加到这里 -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 进度显示区域 -->
            <div class="row mb-4" id="progress-section" style="display: none;">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">
                            <h5 class="mb-0">测试进度</h5>
                        </div>
                        <div class="card-body">
                            <div class="progress mb-3" style="height: 30px;">
                                <div id="progress-bar" class="progress-bar progress-bar-striped progress-bar-animated" 
                                     role="progressbar" style="width: 0%">0%</div>
                            </div>
                            <div id="progress-message" class="alert alert-info">准备开始...</div>
                            <div id="progress-log" class="log-container">
                                <!-- 日志将显示在这里 -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 结果显示区域 -->
            <div class="row mb-4" id="result-section" style="display: none;">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header d-flex justify-content-between align-items-center">
                            <h5 class="mb-0">测试报告</h5>
                            <button class="btn btn-success" onclick="downloadExcel()">
                                <span>📥</span> 下载Excel报告
                            </button>
                        </div>
                        <div class="card-body">
                            <div id="report-content">
                                <!-- 报告内容将显示在这里 -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/socket.io-client@4.5.0/dist/socket.io.min.js"></script>
    <script src="{{ url_for('static', filename='js/main.js') }}"></script>
</body>
</html>


